package com.chidopi.member.dao;

import java.util.List;

import com.chidopi.member.domain.Book2City;
import com.chidopi.member.domain.BookCities;
import com.chidopi.member.domain.BookItems;
import com.chidopi.member.domain.Member2Book;
import com.chidopi.member.domain.Member2Device;
import com.chidopi.member.domain.Member2Subscribe;
import com.chidopi.member.domain.Member2SubscribeHis;
import com.chidopi.member.domain.Members;
import com.chidopi.member.domain.Subscriptions;

public interface IMemberDao {
	public int insertMember2Device(Member2Device mem2dev);
	public int updateMember2Device(Member2Device mem2dev);
	public List<Member2Device> findMember2Device(String email, int city_id);
	public int checkMember2Device(String email, int city_id, String device, String genkey);	// 檢查是否合法設備
	public BookCities findBookCitiesById(int city_id);
	public BookItems findBookItemsById(int book_id);
	public Member2Device findMember2DeviceById(String email, int city_id, String device);
	public Book2City findBook2CityByPK(int city_id, int book_id);
	public int validateMember(String email, int city_id, String pwd);
	public Members getMember(String email, int city_id);
	public int updateMember(Members member);
	
	public List<Member2Subscribe> findMember2Subscribe(String email, int city_id);
	public List<Member2Subscribe> findMember2SubscribeByNoStart(String email, int city_id);
	public Member2Subscribe checkMember2Subscribe(String email, int city_id);	// 檢查是在訂閱中
	public int insertMember2Subscribe(Member2Subscribe mem2sub);
	public int insertMember2SubscribeHis(Member2SubscribeHis mem2subHis);
	public int updateMember2Subscribe(Member2Subscribe mem2sub);
	public Subscriptions findSubscriptionById(int id);
	
	public int insertMember2Book(Member2Book mem2bok);
	public int updateMember2Book(Member2Book mem2bok);
	public List<Member2Book> findMember2Book(Member2Device mem2dev);
	public int getCityIDByRoleId(int role_id);
}
